package domain;

import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.commons.dbcp2.BasicDataSourceFactory;

import javax.sql.DataSource;
import java.io.FileInputStream;
import java.util.Properties;

public class DBCPUtils {
  private static Properties p = new Properties();
  public static DataSource ds = null;

  static {
    try {
     FileInputStream is = new FileInputStream("resource/dbcp.properties");
    p.load(is);
    ds = BasicDataSourceFactory.createDataSource(p);
      System.out.println(ds);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}
